import request from "@/request";

/**
 * 获取字典
 * 
*/
export function getDictList({ code }) {
  return request({
    url: `system-server/dict/list/${code}`,
    method: "get"
  });
}

/**
* 获取所有的字典
* 
*/
export function getAllDictList() {
  return request({
    url: `system-server/dict/list`,
    method: "get"
  });
}
/**
 * 获取字典类型分页列表
 */
export function getDictTypeList(query) {
  return request({
    url: `/system-server/dictType/manage/page`,
    method: "get",
    params: query
  });
}

/**
 * 删除字典类型
 */
export function deleteDictType(uuid) {
  return request({
    url: `/system-server/dictType/manage/${uuid}`,
    method: "delete",
  });
}
/**
 * 更新字典类型
 */
export function updateDictType(data) {
  return request({
    url: `/system-server/dictType/manage`,
    method: "put",
    data: data
  });
}

/**
 * 新增字典类型
 */
export function addDictType(data) {
  return request({
    url: `/system-server/dictType/manage`,
    method: "post",
    data: data
  });
}
/**
 * 获取字典分页列表
 */
export function getDictPageList(query) {
  return request({
    url: `/system-server/dict/manage/page`,
    method: "get",
    params: query
  });
}
/**
 * 删除字典
 */
export function deleteDict(uuid) {
  return request({
    url: `/system-server/dict/manage/${uuid}`,
    method: "delete",
  });
}
/**
 * 更新字典
 */
export function updateDict(data) {
  return request({
    url: `/system-server/dict/manage`,
    method: "put",
    data: data
  });
}

/**
 * 新增字典
 */
export function addDict(data) {
  return request({
    url: `/system-server/dict/manage`,
    method: "post",
    data: data
  });
}

/**
 * 门店商品下拉列表获取字典值
 */
export function getStoreDictList() {
  return request({
    url: `/system-server/dict/storeList`,
    method: "get",
  });
}
/**
 * 获取版本号
 */
export function getVersion() {
  return request({
    url: `/system-server/dict/getVersion`,
    method: "get",
    noToken: true
  });
}